package Homework.Three;

import java.io.*;
import java.nio.charset.StandardCharsets;

public class Test3 {
    public static void main(String[] args) throws FileNotFoundException {
        try {
            FileOutputStream fos = new FileOutputStream("testpw.txt");
            OutputStreamWriter osw = new OutputStreamWriter(fos, StandardCharsets.UTF_8);
            BufferedWriter bw = new BufferedWriter(osw);
            PrintWriter p = new PrintWriter(bw,true);
            p.write("我爱java");
            p.close();
        }catch (Exception e){
            System.out.println("出错");
        }
        System.out.println("程序执行完步");


    }
}
